#!/bin/bash
curl -L -o /tmp/install.sh https://gitee.com/batcom/scripts/raw/master/ginstall.sh
bash /tmp/install.sh
#echo "unalias g" >> ~/.bashrc # 可选。若其他程序（如'git'）使用了'g'作为别名。
source ~/.bashrc

latestVerion=`g ls-remote stable|tail -1|awk '{print $2}'`
g install $latestVerion
echo 'go env -w GO111MODULE=on'>>~/.bashrc
echo 'go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct'>>~/.bashrc
source ~/.bashrc